<template>
  <div class="home">
    <keep-alive include="find">
      <router-view></router-view>
    </keep-alive>

    <!-- 标签栏
     van-tabbar
        v-model="选中某项的索引"
        active-color:选中后的颜色
        inactive-color:不选中时的颜色
        route:(在路由模式下v-model无效)路由模式 对应子项的to,可省去v-model
        placeholder:生成一个等高的元素占位
        van-tabbar-item icon
                to:对应path地址   在需要跳转的子标签上加上一个to对应组件的path
        slot="icon"           
      -->

    <!-- 配制route模式 -->
    <van-tabbar
      route
      active-color="#e40137"
      inactive-color="#b4b4bd"
      placeholder
      v-if="$route.meta.needTab"
    >
      <van-tabbar-item>
        <span> 公司</span>
        <template #icon>
          <i class="iconfont f28"> &#xe63b; </i>
        </template>
      </van-tabbar-item>
      <van-tabbar-item to="/home/question">
        <span>刷题</span>
        <template #icon>
          <i class="iconfont f28">&#xe63f;</i>
        </template>
      </van-tabbar-item>
      <van-tabbar-item to="/home/find">
        <span>发现</span>
        <template #icon>
          <i class="iconfont f28">&#xe63a;</i>
        </template>
      </van-tabbar-item>
      <van-tabbar-item to="/home/my">
        <span>我的</span>
        <template #icon>
          <i class="iconfont f28">&#xe64b;</i>
        </template>
      </van-tabbar-item>
    </van-tabbar>
  </div>
</template>

<script>
export default {
  data () {
    return {
      active: 0
    }
  }
}
</script>

<style lang="less" scoped>
.home {
  height: 100%;
  .f28 {
    font-size: 28px;
  }
}
</style>
